package com.citicup.backend.entity;

import javax.persistence.*;

//TODO 没写日期
@Entity
@Table(name = "stock_daily", schema = "citicup2020")
public class StockDaily {
    private int id;
    private Double csi300;
    private Double shanghaiCompositeIndex;
    private Double shenzhenStockExchangeComponentIndex;
    private Double growthEnterpriseIndex;
    private Double smallCupIndex;
    private String date;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "CSI300")
    public Double getCsi300() {
        return csi300;
    }

    public void setCsi300(Double csi300) {
        this.csi300 = csi300;
    }

    @Basic
    @Column(name = "shanghai_composite_index")
    public Double getShanghaiCompositeIndex() {
        return shanghaiCompositeIndex;
    }

    public void setShanghaiCompositeIndex(Double shanghaiCompositeIndex) {
        this.shanghaiCompositeIndex = shanghaiCompositeIndex;
    }

    @Basic
    @Column(name = "shenzhen_stock_exchange_component_index")
    public Double getShenzhenStockExchangeComponentIndex() {
        return shenzhenStockExchangeComponentIndex;
    }

    public void setShenzhenStockExchangeComponentIndex(Double shenzhenStockExchangeComponentIndex) {
        this.shenzhenStockExchangeComponentIndex = shenzhenStockExchangeComponentIndex;
    }

    @Basic
    @Column(name = "growth_enterprise_index")
    public Double getGrowthEnterpriseIndex() {
        return growthEnterpriseIndex;
    }

    public void setGrowthEnterpriseIndex(Double growthEnterpriseIndex) {
        this.growthEnterpriseIndex = growthEnterpriseIndex;
    }

    @Basic
    @Column(name = "small_cup_index")
    public Double getSmallCupIndex() {
        return smallCupIndex;
    }

    public void setSmallCupIndex(Double smallCupIndex) {
        this.smallCupIndex = smallCupIndex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        StockDaily that = (StockDaily) o;

        if (id != that.id) return false;
        if (csi300 != null ? !csi300.equals(that.csi300) : that.csi300 != null) return false;
        if (shanghaiCompositeIndex != null ? !shanghaiCompositeIndex.equals(that.shanghaiCompositeIndex) : that.shanghaiCompositeIndex != null)
            return false;
        if (shenzhenStockExchangeComponentIndex != null ? !shenzhenStockExchangeComponentIndex.equals(that.shenzhenStockExchangeComponentIndex) : that.shenzhenStockExchangeComponentIndex != null)
            return false;
        if (growthEnterpriseIndex != null ? !growthEnterpriseIndex.equals(that.growthEnterpriseIndex) : that.growthEnterpriseIndex != null)
            return false;
        if (smallCupIndex != null ? !smallCupIndex.equals(that.smallCupIndex) : that.smallCupIndex != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (csi300 != null ? csi300.hashCode() : 0);
        result = 31 * result + (shanghaiCompositeIndex != null ? shanghaiCompositeIndex.hashCode() : 0);
        result = 31 * result + (shenzhenStockExchangeComponentIndex != null ? shenzhenStockExchangeComponentIndex.hashCode() : 0);
        result = 31 * result + (growthEnterpriseIndex != null ? growthEnterpriseIndex.hashCode() : 0);
        result = 31 * result + (smallCupIndex != null ? smallCupIndex.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "date")
    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }
}
